import 'package:flutter/material.dart';

import '../core/elegance_theme.dart';

/// Elegance控件库的默认主题实现
///
/// 这个文件包含了具体的主题实现，提供亮色和深色主题的具体值

/// 默认主题实现类
///
/// 提供具体的亮色和深色主题实现
class DefaultThemeImplementations {
  // 禁止实例化
  DefaultThemeImplementations._();

  /// 创建默认的亮色主题
  static EleganceThemeData createLightTheme() {
    // 主题色系列
    const primaryColor = Color(0xFF2C3E50);
    const primaryDark = Color(0xFF2C3E50);
    const primaryDisabled = Color(0xFFA0CFFF);
    const primaryLight = Color(0xFFECF5FF);

    // 成功色系列
    const successColor = Color(0xFF19BE6B);
    const successDark = Color(0xFF18B566);
    const successDisabled = Color(0xFF71D5A1);
    const successLight = Color(0xFFDBF1E1);

    // 错误色系列
    const errorColor = Color(0xFFFA3534);
    const errorDark = Color(0xFFDD6161);
    const errorDisabled = Color(0xFFFAB6B6);
    const errorLight = Color(0xFFFEF0F0);

    // 警告色系列
    const warningColor = Color(0xFFff9900);
    const warningDark = Color(0xFFf29100);
    const warningDisabled = Color(0xFFFCBD71);
    const warningLight = Color(0xFFFDF6EC);

    // 信息色系列
    const infoColor = Color(0xFF909399);
    const infoDark = Color(0xFF82848A);
    const infoDisabled = Color(0xFFC8C9CC);
    const infoLight = Color(0xFFF4F4F5);

    // 文本颜色系列
    const textPrimaryColor = Color(0xFF303133);
    const textRegularColor = Color(0xFF606266);
    const textSecondaryColor = Color(0xFF909399);
    const textPlaceholderColor = Color(0xFFC0C4CC);

    // 背景和边框颜色
    const backgroundColor = Color(0xFFF3F4F6);
    const surfaceColor = Color(0xFFFFFFFF);
    const borderColor = Color(0xFFE4E7ED);

    //边框色
    const primaryBorderColor = Color(0xDCDFE6FF);
    const secondaryBorderColor = Color(0xE4E7EDFF);
    const thirdBorderColor = Color(0xEBEEF5FF);
    const fourthBorderColor = Color(0xF2F6FCFF);

    //基础色
    const blackColor = Color(0x000000FF);
    const whiteColor = Color(0xFFFFFFFF);

    // 圆角配置
    const borderRadius = 4.0;
    const borderRadiusSmall = 4.0;
    const borderRadiusLarge = 4.0;
    const borderRadiusXLarge = 4.0;
    const borderRadiusFull = 4.0;

    // 边框宽度
    const borderWidth = 1.0;
    const borderWidthThin = 0.5;
    const borderWidthThick = 2.0;

    // 间距配置
    const spacingXS = 4.0;
    const spacingS = 8.0;
    const spacingM = 16.0;
    const spacingL = 24.0;
    const spacingXL = 32.0;
    const spacingXXL = 48.0;

    // 文本样式
    final textStyle = TextStyle(
      fontSize: 16,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleSmall = TextStyle(
      fontSize: 14,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleLarge = TextStyle(
      fontSize: 18,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleHeading1 = TextStyle(
      fontSize: 24,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading2 = TextStyle(
      fontSize: 22,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading3 = TextStyle(
      fontSize: 20,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading4 = TextStyle(
      fontSize: 18,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading5 = TextStyle(
      fontSize: 16,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading6 = TextStyle(
      fontSize: 14,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final buttonTextStyle = TextStyle(
      fontSize: 16,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    final buttonTextStyleSmall = TextStyle(
      fontSize: 14,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    final buttonTextStyleLarge = TextStyle(
      fontSize: 18,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    // 阴影配置
    const shadowSmall = BoxShadow(
      color: Color(0x10000000),
      blurRadius: 2,
      offset: Offset(0, 1),
    );

    const shadowMedium = BoxShadow(
      color: Color(0x20000000),
      blurRadius: 4,
      offset: Offset(0, 2),
    );

    const shadowLarge = BoxShadow(
      color: Color(0x30000000),
      blurRadius: 8,
      offset: Offset(0, 4),
    );

    const shadowElevation1 = [
      BoxShadow(color: Color(0x10000000), blurRadius: 2, offset: Offset(0, 1)),
    ];

    const shadowElevation2 = [
      BoxShadow(color: Color(0x20000000), blurRadius: 4, offset: Offset(0, 2)),
    ];

    const shadowElevation3 = [
      BoxShadow(color: Color(0x30000000), blurRadius: 8, offset: Offset(0, 4)),
    ];

    const shadowElevation4 = [
      BoxShadow(color: Color(0x40000000), blurRadius: 16, offset: Offset(0, 8)),
    ];

    return EleganceThemeData(
      primaryDark: primaryDark,
      primaryDisabled: primaryDisabled,
      primaryLight: primaryLight,
      successColor: successColor,
      successDark: successDark,
      successDisabled: successDisabled,
      successLight: successLight,
      errorColor: errorColor,
      errorDark: errorDark,
      errorDisabled: errorDisabled,
      errorLight: errorLight,
      warningColor: warningColor,
      warningDark: warningDark,
      warningDisabled: warningDisabled,
      warningLight: warningLight,
      infoColor: infoColor,
      infoDark: infoDark,
      infoDisabled: infoDisabled,
      infoLight: infoLight,
      textPrimaryColor: textPrimaryColor,
      textRegularColor: textRegularColor,
      textSecondaryColor: textSecondaryColor,
      textPlaceholderColor: textPlaceholderColor,
      backgroundColor: backgroundColor,
      surfaceColor: surfaceColor,
      borderColor: borderColor,
      borderRadius: borderRadius,
      borderRadiusSmall: borderRadiusSmall,
      borderRadiusLarge: borderRadiusLarge,
      borderRadiusXLarge: borderRadiusXLarge,
      borderRadiusFull: borderRadiusFull,
      borderWidth: borderWidth,
      borderWidthThin: borderWidthThin,
      borderWidthThick: borderWidthThick,
      spacingXS: spacingXS,
      spacingS: spacingS,
      spacingM: spacingM,
      spacingL: spacingL,
      spacingXL: spacingXL,
      spacingXXL: spacingXXL,
      textStyle: textStyle,
      textStyleSmall: textStyleSmall,
      textStyleLarge: textStyleLarge,
      textStyleHeading1: textStyleHeading1,
      textStyleHeading2: textStyleHeading2,
      textStyleHeading3: textStyleHeading3,
      textStyleHeading4: textStyleHeading4,
      textStyleHeading5: textStyleHeading5,
      textStyleHeading6: textStyleHeading6,
      buttonTextStyle: buttonTextStyle,
      buttonTextStyleSmall: buttonTextStyleSmall,
      buttonTextStyleLarge: buttonTextStyleLarge,
      shadowSmall: shadowSmall,
      shadowMedium: shadowMedium,
      shadowLarge: shadowLarge,
      shadowElevation1: shadowElevation1,
      shadowElevation2: shadowElevation2,
      shadowElevation3: shadowElevation3,
      shadowElevation4: shadowElevation4,
      primaryColor: primaryColor,
      customProperties: {},
    );
  }

  /// 创建默认的深色主题
  static EleganceThemeData createDarkTheme() {
    // 主题色系列
    const primaryColor = Color(0xFF2979FF);
    const primaryDark = Color(0xFF2B85E4);
    const primaryDisabled = Color(0xFF4080FF);
    const primaryLight = Color(0xFF0A2463);

    // 成功色系列
    const successColor = Color(0xFF19BE6B);
    const successDark = Color(0xFF18B566);
    const successDisabled = Color(0xFF40BE83);
    const successLight = Color(0xFF072216);

    // 错误色系列
    const errorColor = Color(0xFFFA3534);
    const errorDark = Color(0xFFDD6161);
    const errorDisabled = Color(0xFFF76663);
    const errorLight = Color(0xFF34100F);

    // 警告色系列
    const warningColor = Color(0xFFff9900);
    const warningDark = Color(0xFFf29100);
    const warningDisabled = Color(0xFFFBA63C);
    const warningLight = Color(0xFF362508);

    // 信息色系列
    const infoColor = Color(0xFF909399);
    const infoDark = Color(0xFF82848A);
    const infoDisabled = Color(0xFF9DA1A6);
    const infoLight = Color(0xFF212224);

    // 文本颜色系列
    const textPrimaryColor = Color(0xFFE5E5E5);
    const textRegularColor = Color(0xFFBFBFBF);
    const textSecondaryColor = Color(0xFF8C8C8C);
    const textPlaceholderColor = Color(0xFF595959);

    // 背景和边框颜色
    const backgroundColor = Color(0xFF1A1A1A);
    const surfaceColor = Color(0xFF262626);
    const borderColor = Color(0xFF404040);

    // 圆角配置（与亮色主题相同）
    const borderRadius = 8.0;
    const borderRadiusSmall = 4.0;
    const borderRadiusLarge = 12.0;
    const borderRadiusXLarge = 16.0;
    const borderRadiusFull = 9999.0;

    // 边框宽度（与亮色主题相同）
    const borderWidth = 1.0;
    const borderWidthThin = 0.5;
    const borderWidthThick = 2.0;

    // 间距配置（与亮色主题相同）
    const spacingXS = 4.0;
    const spacingS = 8.0;
    const spacingM = 16.0;
    const spacingL = 24.0;
    const spacingXL = 32.0;
    const spacingXXL = 48.0;

    // 文本样式（与亮色主题相同，仅颜色不同）
    final textStyle = TextStyle(
      fontSize: 16,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleSmall = TextStyle(
      fontSize: 14,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleLarge = TextStyle(
      fontSize: 18,
      color: textPrimaryColor,
      fontWeight: FontWeight.normal,
    );

    final textStyleHeading1 = TextStyle(
      fontSize: 24,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading2 = TextStyle(
      fontSize: 22,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading3 = TextStyle(
      fontSize: 20,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading4 = TextStyle(
      fontSize: 18,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading5 = TextStyle(
      fontSize: 16,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final textStyleHeading6 = TextStyle(
      fontSize: 14,
      color: textPrimaryColor,
      fontWeight: FontWeight.bold,
    );

    final buttonTextStyle = TextStyle(
      fontSize: 16,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    final buttonTextStyleSmall = TextStyle(
      fontSize: 14,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    final buttonTextStyleLarge = TextStyle(
      fontSize: 18,
      color: Colors.white,
      fontWeight: FontWeight.w500,
    );

    // 阴影配置（深色主题中阴影通常更暗）
    const shadowSmall = BoxShadow(
      color: Color(0x20000000),
      blurRadius: 2,
      offset: Offset(0, 1),
    );

    const shadowMedium = BoxShadow(
      color: Color(0x30000000),
      blurRadius: 4,
      offset: Offset(0, 2),
    );

    const shadowLarge = BoxShadow(
      color: Color(0x40000000),
      blurRadius: 8,
      offset: Offset(0, 4),
    );

    const shadowElevation1 = [
      BoxShadow(color: Color(0x20000000), blurRadius: 2, offset: Offset(0, 1)),
    ];

    const shadowElevation2 = [
      BoxShadow(color: Color(0x30000000), blurRadius: 4, offset: Offset(0, 2)),
    ];

    const shadowElevation3 = [
      BoxShadow(color: Color(0x40000000), blurRadius: 8, offset: Offset(0, 4)),
    ];

    const shadowElevation4 = [
      BoxShadow(color: Color(0x50000000), blurRadius: 16, offset: Offset(0, 8)),
    ];

    return EleganceThemeData(
      primaryDark: primaryDark,
      primaryDisabled: primaryDisabled,
      primaryLight: primaryLight,
      successColor: successColor,
      successDark: successDark,
      successDisabled: successDisabled,
      successLight: successLight,
      errorColor: errorColor,
      errorDark: errorDark,
      errorDisabled: errorDisabled,
      errorLight: errorLight,
      warningColor: warningColor,
      warningDark: warningDark,
      warningDisabled: warningDisabled,
      warningLight: warningLight,
      infoColor: infoColor,
      infoDark: infoDark,
      infoDisabled: infoDisabled,
      infoLight: infoLight,
      textPrimaryColor: textPrimaryColor,
      textRegularColor: textRegularColor,
      textSecondaryColor: textSecondaryColor,
      textPlaceholderColor: textPlaceholderColor,
      backgroundColor: backgroundColor,
      surfaceColor: surfaceColor,
      borderColor: borderColor,
      borderRadius: borderRadius,
      borderRadiusSmall: borderRadiusSmall,
      borderRadiusLarge: borderRadiusLarge,
      borderRadiusXLarge: borderRadiusXLarge,
      borderRadiusFull: borderRadiusFull,
      borderWidth: borderWidth,
      borderWidthThin: borderWidthThin,
      borderWidthThick: borderWidthThick,
      spacingXS: spacingXS,
      spacingS: spacingS,
      spacingM: spacingM,
      spacingL: spacingL,
      spacingXL: spacingXL,
      spacingXXL: spacingXXL,
      textStyle: textStyle,
      textStyleSmall: textStyleSmall,
      textStyleLarge: textStyleLarge,
      textStyleHeading1: textStyleHeading1,
      textStyleHeading2: textStyleHeading2,
      textStyleHeading3: textStyleHeading3,
      textStyleHeading4: textStyleHeading4,
      textStyleHeading5: textStyleHeading5,
      textStyleHeading6: textStyleHeading6,
      buttonTextStyle: buttonTextStyle,
      buttonTextStyleSmall: buttonTextStyleSmall,
      buttonTextStyleLarge: buttonTextStyleLarge,
      shadowSmall: shadowSmall,
      shadowMedium: shadowMedium,
      shadowLarge: shadowLarge,
      shadowElevation1: shadowElevation1,
      shadowElevation2: shadowElevation2,
      shadowElevation3: shadowElevation3,
      shadowElevation4: shadowElevation4,
      primaryColor: primaryColor,
      customProperties: {},
    );
  }
}
